package BehaviorDesignPattern.ChainOfResponsibilityPattern;

public class TestChainOfResponsibilityPattern {
    public static void main(String[] args) {
        // 创建责任链上的处理者
        Approver teamLeader = new TeamLeader();
        Approver manager = new Manager();
        Approver director = new Director();

        // 设置责任链
        teamLeader.setNextApprover(manager);  // 组长的下一个处理者是经理
        manager.setNextApprover(director);    // 经理的下一个处理者是总监

        // 模拟报销请求
        System.out.println("处理100元的请求：");
        teamLeader.approveRequest(100);

        System.out.println();

        System.out.println("处理3000元的请求：");
        teamLeader.approveRequest(3000);

        System.out.println();

        System.out.println("处理8000元的请求：");
        teamLeader.approveRequest(8000);

        System.out.println();

        System.out.println("处理15000元的请求：");
        teamLeader.approveRequest(15000);
    }
}
